package org.hoyi.hrpc;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * 
 * Hoyi 动态代理实现.
 * @author ellen
 * 
 *
 */
public class HOYIProxy  implements InvocationHandler{
	
	private Object subject;
	
	public  HOYIProxy(Object _subject) {
		this.subject = _subject;
	}
	
	
	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		System.out.println("before rent house");
		
		System.out.println("Method: " + method);
		
//		method.invoke(subject, args);
		
		// 这里发送远程请求.
		System.out.println("这里发送远程请求!~");
		
		System.out.println("after rent house");
		return null;
	}

}














